<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=1, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="./lib/vue.js"></script>
    <link rel="stylesheet" href="./lib/bootstrap.css">
    <title>商品管理列表</title>
</head>
<body>
    <div id="app">
        <table class="table table-bordered table-hover table-striped">
            <thead>
                <tr>
                    <th>id</th>
                    <th>name</th>
                    <th>time</th>
                    <th>option</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="item in productlist">
                    <td>{{item.id}}</td>
                    <td>{{item.name}}</td>
                    <td>{{item.time}}</td>
                    <td>
                        <a href="" @click.prevent="del()">删除</a>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</body>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
            productlist:[
                {id:1,name:'宝马',time:new Date()},
                {id:2,name:'奔驰',time:new Date()},
            ]
        },
        methods:{
            del(){
                console.log('删除')
            }

        },
    })
</script>
</html>